using System;

namespace TenantManagementService.Exceptions;

/// <summary>
/// 租户代码已存在异常
/// </summary>
public class TenantCodeAlreadyExistsException : TenantManagementException
{
    public string TenantCode { get; } = string.Empty;

    public TenantCodeAlreadyExistsException()
    {
    }

    public TenantCodeAlreadyExistsException(string tenantCode)
        : base($"租户代码 '{tenantCode}' 已存在")
    {
        TenantCode = tenantCode;
    }

    public TenantCodeAlreadyExistsException(string tenantCode, Exception innerException)
        : base($"租户代码 '{tenantCode}' 已存在", "TENANT_CODE_EXISTS", innerException)
    {
        TenantCode = tenantCode;
    }
}